package com.edgar.loglib;

import android.content.Context;

import java.io.IOException;
import java.util.Properties;

/**
 * Created by edgar on 2015/12/26.
 * The log config.
 */
public class LogConfig {
    public static final String LOG_CONFIG = "log_config.properties";
    private String mCrashPath;
    private String mLogFilePath;

    public LogConfig(Context context){
        initConfig(context);
    }

    /**
     * 初始化配置
     * @param context
     */
    private void initConfig(Context context){
        Properties properties = new Properties();
        try {
            properties.load(context.getAssets().open(LOG_CONFIG));
            mCrashPath = properties.getProperty("crash_file_path");
            mLogFilePath = properties.getProperty("log_file_path");
        } catch (IOException e) {
            //ignore
        }
    }

    public String getCrashPath(){
        return mCrashPath;
    }

    public String getLogPath(){
        return mLogFilePath;
    }
}